When information, of an image or a voice is transmitted/stored as a digital signal, a coding technology that uses its redundancy to reduce a data volume is widely used. In this case, if distortion is permitted to a reproduced signal based on the fact that human audio-visual characteristics include insensitiveness to small distortion, compression can be performed at a higher level. Such a coding method is called lossy coding because an original signal is not accurately reproduced.
A method of decoding data coded by lossy coding can generally be realized by performing its inverse processing when a coding method is provided. FIG. 8 is a block diagram showing a decoder of JPEG (Joint Photographic Experts Group) coded data widely used for, e.g., image coding, which is disclosed in p. 21 of IEEE Transactions on Consumer Electronics, February 1992. The decoder shown in FIG. 8 includes a variable length decoder 80 for receiving a coded stream, an inverse quantizer 81, an inverse DCT (Discrete Cosine Transform) converter 82, a limiter 83, and an integer-conversion unit 84. While not disclosed in the above document, the limiter 83 and the integer-conversion unit 84 are generally widely used, and added to description below as they are important.
Next, an operation will be described. The JPEG coding is designed to subject the original signal to DCT conversion by a block unit, thereby coding its quantized index. Thus, the decoder only needs to perform its inverse process. In FIG. 8, the variable length decoder 80 decodes a JPEG stream into a quantized index of a DCT coefficient. The inverse DCT converter 82 subjects the DCT coefficient to inverse conversion to reproduce the original signal. An output of the inverse DCT converter 82 is a real number. When the reproduced signal is digitally represented, it must be converted into a discrete signal of a certain range. This conversion is performed by the limiter 83 and the integer-conversion unit 84. The limiter 83 clips the output of the inverse DCT converter 82 in an existing range, and the integer-conversion unit 23 converts its result into an integer. The clipping and the integer-conversion may be reverse in order. As a result, for an output of the integer-conversion unit 84, an output of a form to be represented as digital data is obtained. The process is performed by block units, and all blocks are integrated to obtain decoded data at the end.
The process of the limiter 83 and the integer-conversion unit 84 is many-to-one mapping. Thus, the original DCT coefficient cannot be restored from its output. This means that information of a part of the quantized index of the DCT coefficient represented as the stream is lost by decoding.
This information loss has not posed a big problem as long as an image to be reproduced exists only to be consumed by a human. In other words, such an error introduced by decoding has not been a problem because it is too small to be sensed by the human. However, communication diversity has been accompanied by recognition that it is important to hold a structure of a coded image. For example, for secondary use, a decoded image may be recoded losslessly, information such as an electronic watermark may be contained in the image, and thus the information must be held even after decoding. A conventional decoding method cannot guarantee lossless recoding or a remaining watermark.
The conventional decoding method of coded data has a problem that when an error is introduced as a result of clipping or integer-conversion of an inversely converted signal, and a decoded signal is coded again, the same coded stream cannot be obtained.
Furthermore, the error caused by the clipping or the integer-conversion poses a problem that information embedded in the quantized DCT coefficient is lost.
The present invention has been made to solve the above problems, and has an object to provide a program, a method, and an apparatus for decoding coded data, which are capable of completely restoring an original stream when decoded data is coded again.
It is another object to provide a program, a method, and an apparatus for decoding coded data, which are capable of completely holding information embedded in a quantized DCT coefficient by maintaining a structure of a signal represented as a stream within a certain range of quantization accuracy.